.\"	$NetBSD$
.\"
.\" Copyright (c) 2023 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Thomas Klausner.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd July 8, 2023
.Dt CVS2FOSSIL 1
.Os
.Sh NAME
.Nm cvs2fossil
.Nd convert CVS repository to fossil
.Sh SYNOPSIS
.Nm
.Op Fl m
.Op Fl f Ar fixup-sql-script
.Op Fl s Ar merge-limit-seconds
.Ar source
.Ar destination
.Sh DESCRIPTION
.Nm
is a script to convert a
.Xr cvs 1
repository to a
.Xr fossil 1
repository.
.Pp
.Ar source
must be a CVS repository (the server side, i.e. the RCS files, not a
checkout).
.Nm
will create
.Ar destination ,
an intermediate
.Xr sqlite3 1
database, and
.Ar destination Ns Pa .fossil ,
the fossil conversion.
It will also run some tests on the conversion to report possible problems.
.Pp
Supported options:
.Bl -tag -width 8n
.It Fl f Ar fixup-sql-script
Run the SQL code in
.Ar fixup-sql-script
early in the conversion.
This script should be used to fix timewarp issues in the repository.
See the
.Nm
source code for details.
.It Fl m
Remove the top-level directory from the imported file paths,
i.e. when converting
.Pa foo/bar/*
the path names in the result will start with
.Pa bar .
.It Fl s Ar merge-limit-seconds
Some CVS operations take longer because of network speed or number and
size of files involved.
Thus, RCS dates of files belonging to one commit may have different
time stamps.
For this reason,
.Nm
merges changes to files that have the same commit message but slightly
varying time stamps into one commit.
The
.Ar merge-limit-seconds
argument specifies the maximum number of seconds two commits may be
apart (using the RCS date of the change) before they are seen as two
separate commits.
The default is 600 seconds (10 minutes).
.El
.Sh WARNINGS
These warnings usually indicate that some manual changes were done
to the RCS files.
.Bl -ohang
.It Dq Files with default branch, but no vendor branch
The branch symbol for the vendor branch was removed.
.It Dq Disconnected revisions
The branch symbol was removed, but the revision was left lying around.
.It Dq Revisions not newer than previous revision
A newer revision of a file has an older timestamp than an older
revision it is based on.
.El
.Sh SEE ALSO
.Xr cvs 1 ,
.Xr fossil 1 ,
.Xr sqlite3 1
